<!DOCTYPE html>
<html lang="en" class="app">
<head>
  <meta charset="utf-8" />
  <?php echo $this->Html->charset(); ?>
  <title><?php echo $title_for_layout; ?></title>


    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <?php
		echo $this->Html->meta('icon');

		echo $this->Html->css('bootstrap.min');
		echo $this->Html->css('fonts');
		echo $this->Html->css('font-awesome/css/font-awesome.min');
		echo $this->Html->css('only-for-demos');

		echo $this->Html->css('themes/style', array('id' => 'qstyle'));

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('js');
	?>

    <!-- Tc core CSS -->
	<!--[if lte IE 8]>
	<?php
		echo $this->Html->css('ie-fix');
	?>
	<![endif]-->


    <!--[if lt IE 9]>
    <?php
    	echo $this->Html->script('html5shiv');
    	echo $this->Html->script('respond.min');
    ?>
    <![endif]-->

    <?php
    	echo $this->Html->script('jquery-1.9.1');
    	echo $this->Html->script('jquery.min');
    	echo $this->Html->script('bootstrap.min');
    ?>


    <script>
		$webroot = '<?php echo $this->webroot; ?>';
		$full_base_url = '<?php echo FULL_BASE_URL. $this->webroot; ?>';
	</script>
</head>

<body>

<div id="wrapper">
		<div id="main-container">
			<!-- BEGIN TOP NAVIGATION -->
				<nav class="navbar-top" role="navigation">
					<!-- BEGIN BRAND HEADING -->
					<div class="navbar-header">
						<button type="button" class="navbar-toggle pull-right" data-toggle="collapse" data-target=".top-collapse">
							<i class="fa fa-bars"></i>
						</button>
						<div class="navbar-brand">
							<a href="/admin">
								<i class="fa fa-desktop"></i>
								SPACEPLUS
							</a>
						</div>
					</div>
					<!-- END BRAND HEADING -->
					<div class="nav-top">
						<!-- BEGIN RIGHT SIDE DROPDOWN BUTTONS -->
							<ul class="nav navbar-right">
								<li class="dropdown">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown">
										<i class="fa fa-envelope"></i>
										<?php if(count($contacts) > 0):?><span class="badge up "><?= count($contacts) ?></span><?php endif; ?>
									</a>

									<ul class="dropdown-menu dropdown-scroll dropdown-messages">
										<li class="dropdown-header">
											<i class="fa fa-envelope"></i> <?= count($contacts) ?> Tin nhắn mới
										</li>
										<?php if(count($contacts) > 0): ?>
										<li id="messageScroll">
											<ul class="list-unstyled">
												<?php foreach($contacts as $ct): ?>
												<li>
													<a href="<?= $this->webroot.'admin/contacts/detail/'.$ct['Contact']['id'] ?>">
														<div class="row">
															<div class="col-xs-10">
																<p> <strong><?= $ct['Contact']['fullname']; ?></strong>: <?= $ct['Contact']['title']; ?> </p>
															</div>
														</div>
													</a>
												</li>
												<?php endforeach; ?>
											</ul>
										</li>
										<?php endif; ?>
									</ul>
								</li>

								<li class="dropdown user-box">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown">
										<img class="img-circle" src="<?php echo $this->webroot; ?>img/user.png" alt=""> <span class="user-info"><?php echo $global_user['full_name']?></span> <b class="caret"></b>
									</a>
										<ul class="dropdown-menu dropdown-user">
											<li>
												<a href="<?php echo $this->webroot; ?>admin/users/add/<?php echo $global_user['id']?>">
													<i class="fa fa-user"></i> Sửa thông tin tài khoản
												</a>
											</li>
											<li class="divider"></li>
											<li>
												<a href="<?php echo $this->webroot; ?>admin/logout">
													<i class="fa fa-power-off"></i> Đăng xuất
												</a>
											</li>
										</ul>
								</li>

							</ul>
						<!-- END RIGHT SIDE DROPDOWN BUTTONS -->
						<!-- BEGIN TOP MENU -->
							<div class="collapse navbar-collapse top-collapse">
								<!-- .nav -->
								<ul class="nav navbar-left navbar-nav">
									<li><a href="<?php echo $this->webroot; ?>admin/abouts">Giới Thiệu</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin/contacts">Liên hệ</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin">Danh mục</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin/products">Sản Phẩm</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin/news">Tin Tức</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin/images/images">Hình Ảnh</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin/contacts/map">Bản Đồ</a></li>
									<li><a href="<?php echo $this->webroot; ?>admin/codetbls">Hệ Thống</a></li>

								</ul><!-- /.nav -->
							</div>
						<!-- END TOP MENU -->
					</div><!-- /.nav-top -->
				</nav><!-- /.navbar-top -->
				<!-- END TOP NAVIGATION -->


				<!-- BEGIN SIDE NAVIGATION -->
				<nav class="navbar-side" role="navigation">
					<div class="navbar-collapse sidebar-collapse collapse">

						<ul id="side" class="nav navbar-nav side-nav">
							<!-- BEGIN SIDE NAV MENU -->
							<!-- Navigation category -->
							<!--<li>
								<h4>Sản phẩm</h4>
							</li>-->
							<!-- END Navigation category -->


							<li>
								<a href="<?php echo $this->webroot; ?>admin/abouts" <?php if($controller == 'abouts') echo 'class="active"'?>>
									<i class="fa fa-info-circle"></i> Giới Thiệu
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin/contacts" <?php if($controller == 'contacts'  && $action == 'admin_index') echo 'class="active"'?>>
									<i class="fa fa-map-marker"></i> Liên Hệ
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin" <?php if($controller == 'categories') echo 'class="active"'?>>
									<i class="fa fa-list"></i> Danh Mục
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin/products" <?php if($controller == 'products') echo 'class="active"'?>>
									<i class="fa fa-university"></i> Sản Phẩm
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin/news" <?php if($controller == 'news') echo 'class="active"'?>>
									<i class="fa fa-globe"></i> Tin Tức
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin/images/images" <?php if($controller == 'images') echo 'class="active"'?>>
									<i class="fa fa-picture-o"></i> Hình Ảnh
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin/contacts/map" <?php if($controller == 'contacts' && $action == 'admin_map') echo 'class="active"'?>>
									<i class="fa fa-map-marker"></i> Bản Đồ
								</a>
							</li>

							<li>
								<a href="<?php echo $this->webroot; ?>admin/codetbls" <?php if($controller == 'codetbls') echo 'class="active"'?>>
									<i class="fa fa-cogs"></i> Hệ Thống
								</a>
							</li>
						</ul><!-- /.side-nav -->

					</div><!-- /.navbar-collapse -->
				</nav><!-- /.navbar-side -->
			<!-- END SIDE NAVIGATION -->


			<!-- BEGIN MAIN PAGE CONTENT -->
				<div id="page-wrapper">

					<?php echo $this->fetch('content'); ?>

					<!-- BEGIN FOOTER CONTENT -->
					<div class="footer">
						<div class="footer-inner">
							<!-- basics/footer -->
							<div class="footer-content">
								2014 &copy; Spaceplus.
							</div>
							<!-- /basics/footer -->
						</div>
					</div>
					<button type="button" id="back-to-top" class="btn btn-default btn-sm back-to-top">
						<i class="fa fa-angle-double-up icon-only bigger-110"></i>
					</button>
					<!-- END FOOTER CONTENT -->
				</div><!-- /#page-wrapper -->
			<!-- END MAIN PAGE CONTENT -->
		</div>
	</div>
	<div id="content-model"></div>


<?php
	echo $this->Html->script('plugins/slimscroll/jquery.slimscroll.min');
	echo $this->Html->script('plugins/pace/pace.min');
	echo $this->Html->script('main');
	echo $this->Html->script('speech-commands');
	echo $this->Html->script('plugins/slimscroll/jquery.slimscroll.init');
?>


</body>
</html>